First let’s set up our chunk options and required libraries. This will minimize clutter and remove unnecessary messages and warnings.
Next we load our dataset from OpenDataPhilly.org. This dataset is a GeoJSON of all the parks in Philadelphia. We use sf::st_read() to read in spatial data like this.
Let’s preview our data. Using mapview::mapview(), we can quickly check what the data looks like.
#<<<<<<< HEAD
#mapview(parks, col.regions = "white", map.types = "CartoDB.DarkMatter")
#=======
mapview(parks, col.regions = "red", map.types = "CartoDB.DarkMatter")
#>>>>>>> 31aa5eff3ca0c95c7fbb05a5fce08214d753ce5e
Finally, let’s map using ggplot2. Add your name as a subtitle in the labs() function. Also feel free to change the colors and other aesthetics. Once you’re satisfied, save and commit.
ggplot() +
geom_sf(data = parks, fill = "chartreuse4", color = "transparent") +
labs(title = "Philadelphia Park System, 2023") +
theme_void()